package cn.kgc.controller;

import cn.kgc.bean.pojo.StHazard;
import cn.kgc.bean.vo.Result;
import cn.kgc.service.StHazardService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @projectName: safetyMag
 * @package: cn.kgc.controller
 * @className: StHazardController
 * @author: yindexin
 * @description: TODO
 * @date: 2023/5/1 17:21
 * @version: 1.0
 */
@RestController
@RequestMapping("stHazard")
public class StHazardController {
    @Resource
    private StHazardService stHazardService;

    @RequestMapping("/getStHazardAll/{pageFrom}/{pageSize}")
    private Result getStHazardAll(@PathVariable Integer pageFrom,
                                  @PathVariable Integer pageSize){
        PageHelper.startPage(pageFrom, pageSize);
        List<StHazard> list = stHazardService.getStHazardAll();
        PageInfo pageInfo = new PageInfo(list);
        return Result.success(pageInfo);
    }
}
